package com.kyle.redpacket.dao.entity;

import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.ToString;

import javax.persistence.Entity;
import javax.persistence.Table;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotNull;
import java.io.Serializable;


/**
 *
 */
@EqualsAndHashCode(callSuper = true)
@Data
@Entity
@Table(name = "RedPacket")
public class RedPacket extends BaseEntityAudit implements Serializable {

    private static final long serialVersionUID = 116748213748L;

    /**
     * 发出红包的用户
     */
    private Long userId;

    //指定多少人抢
    @NotNull
    @Min(1)
    private Long total;

    //指定总金额-单位为分
    @NotNull
    @Min(1)
    private Long amount;

    /**
     * 用来记录唯一性
     */
    private String redId;
}









































